#include <JXQCore/JXQGlobal>
#include <JXQCore/JVariant>
#include <JXQCore/JThread>
#include <JXQCore/JDebug>
#include "mythread.h"

int main(int, char *[])
{
	MyThread thread;
	thread.start();

	JXQ::JVariant var = 155;
	jDebug() << ">----- -- - - --- ---  " << var.type().name() << var.toInt();

	JXQ::JVariant var2(var);
	jDebug() << " /8/8/8/8/8/8/8/8//8/  " << var2.type().name() << var2.toInt();
	var2 = 128;
	jDebug() << "    )0)))))))0)))00)) " << var2.type().name() << var2.toInt();

	var = "hello world";
	jDebug() << ">----- -- - - --- ---  " << var.type().name() << var.toString();

	JXQ::JStringList strList { "hello", "world" };
	auto hw = strList.join(" ");
	jDebug() << "       hw = " << hw;
	auto hwl = hw.split(" ");
	jDebug() << "     ---stringList = " << hwl;
	auto hwl2 = hwl;
	jDebug() << " 2 2 2 ---stringList 222222 = " << hwl2;

	auto sss = JXQ::JString("你好 '%1' -- \"%2\" 世界 %3 ~~").arg("ABC", "&^%#", "巴拉");
	jDebug() << "arg test = " << sss;

	for(double i=0.0; i<30.0; i+=1.2)
	{
		var = var.toDouble() + i;
		jDebug() << var;
		JXQ::JThread::sleep(1);
	}

	thread.detach();
	return 0;
}
